import React, { useEffect } from 'react'
import { Layout } from 'antd'
import IndexSider from '@/pages/Index/components/IndexSider'
import IndexHeader from '@/pages/Index/components/IndexHeader'
import IndexContent from '@/pages/Index/components/IndexContent'
import IndexFooter from '@/pages/Index/components/IndexFooter'
import { useAppDispatch } from '@/hooks'
import { getUserInfoAsync } from '@/store/slice/auth'
import './index.less'

const Index: React.FC = () => {
    const dispatch = useAppDispatch()
    useEffect(() => {
        // 发送异步请求获取用户信息
        dispatch(getUserInfoAsync())
    }, [])
    return (
        <Layout style={{ minHeight: '100vh' }}>
            <IndexSider />
            <Layout className="site-layout">
                <IndexHeader />
                <IndexContent />
                <IndexFooter />
            </Layout>
        </Layout>
    )
}

export default Index
